Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BFT] Epoch Recovery integration test #6823

Open
wants to merge 6 commits into
base: feature/efm-recovery
Choose a base branch
from

Conversation

durkmurder
Copy link
Member

#6645

Context

This PR implements the most general case where Random beacon committee and consensus committee form a symmetric difference with cardinality 1. More details in the attached issue.

@codecov-commenter
Copy link

codecov-commenter commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 6.25000% with 30 lines in your changes missing coverage. Please review.

Project coverage is 41.73%. Comparing base (a35632f) to head (cbed983).

Files with missing lines Patch % Lines
cmd/bootstrap/run/epochs.go 0.00% 30 Missing ⚠️
Additional details and impacted files
@@                   Coverage Diff                    @@
##           feature/efm-recovery    #6823      +/-   ##
========================================================
- Coverage                 41.81%   41.73%   -0.08%     
========================================================
  Files                      1588     2033     +445     
  Lines                    144098   181227   +37129     
========================================================
+ Hits                      60251    75642   +15391     
- Misses                    78887    99361   +20474     
- Partials                   4960     6224    +1264     
Flag Coverage Δ
unittests 41.73% <6.25%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

// enters Epoch Fallback Mode can successfully recover.
// For this specific scenario, we are testing a scenario where the consensus committee and Random Beacon committee form a symmetric difference with
// cardinality 1. In other words, there is a node which is part of the consensus committee but not part of the Random Beacon committee and
// another node which is part of the Random Beacon committee but not part of the consensus committee.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// another node which is part of the Random Beacon committee but not part of the consensus committee.
// another node which is part of the Random Beacon committee but not part of the consensus committee.
// We remove the first consensus node from the Consensus Committee, and the last consensus node from the Random Beacon Committee:
// If the original consensus set is {A, B, C, D} then:
// - the post-recovery consensus committee is {B, C, D}
// - the post-recovery random beacon committee is {A, B, C}
//

internalNodePrivInfoDir, nodeConfigJson := s.getNodeInfoDirs(flow.RoleConsensus)
internalNodes, err := common.ReadFullInternalNodeInfos(unittest.Logger(), internalNodePrivInfoDir, nodeConfigJson)
require.NoError(s.T(), err)
// 3. Eject consensus node by modifying the snapshot before generating the recover epoch transaction args.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// 3. Eject consensus node by modifying the snapshot before generating the recover epoch transaction args.
// 3. Eject the FIRST consensus node by modifying the snapshot before generating the recover epoch transaction args.

dkgIndexMap := make(flow.DKGIndexMap, nConsensusNodes)
for i, participant := range randomBeaconParticipants[:nConsensusNodes] {
dkgIndexMap[participant.NodeID] = i
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
}
}
dkgKeyShares := dkg.KeyShares()[:nConsensusNodes]

Putting this next to the corresponding index map construction logic

3000,
false,
dkgIndexMap,
dkg.KeyShares()[:nConsensusNodes],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dkg.KeyShares()[:nConsensusNodes],
dkgKeyShares,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants